﻿using System;
using System.Collections.Generic;

public class TimeUtil
{
    private static TimeUtil instance = new TimeUtil();
    public static TimeUtil Instance
    {
        get
        {
            return instance;
        }
    }
    private TimeUtil() { }

    public string TimeToString(float time)
    {
        return TimeToString((int)time);
    }

    public string TimeToString(int time)
    {
        TimeSpan timeSpan = TimeSpan.FromSeconds(time);
        if (time <= 60)
        {
            return time.ToString();
        }
        else if (time < 3600)
        {
            return timeSpan.ToString(@"mm\:ss");
        }
        return timeSpan.ToString(@"hh\:mm\:ss");
    }


}
